import os

from langchain import hub
from langchain.agents import create_react_agent, AgentExecutor, ZeroShotAgent, create_structured_chat_agent

from agents.tools.tool_add import add_calculator as add
from agents.tools.tool_multiply import multiply_calculator as multiply

from langchain_community.llms import Tongyi

os.environ["DASHSCOPE_API_KEY"] = "sk-9d8f1914800e497f8717144e860f99bc"

llm = Tongyi()
tools = [add, multiply]
prompt = hub.pull("hwchase17/structured-chat-agent")
agent = create_structured_chat_agent(llm, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
# print(agent_executor.invoke(" '2' + '3' = ?"))
print(agent_executor.invoke({"input": "what is '2' + '3'? "}))
